/**
 * RequireJS build config for prod.
 * Date: 2015/06/09.
 */
{
  baseUrl: "../src/",
  mainConfigFile: "../src/js/site.js",
  // dir: "../built/",
  paths: {
    // 3rd deps.
    jquery: "js/vendor/jquery-1.10.2.min",
    bootstrap: "js/vendor/bootstrap",
    highcharts: "js/vendor/highcharts",
    raphael: "js/vendor/raphael.min",
    morris: "js/vendor/morris.min",
    'jquery.cookie': "js/vendor/jquery.cookie",
    spin: "js/vendor/spin",
    datatables: "js/vendor/jquery.dataTables",
    dataTables_bs: "js/vendor/dataTables.bootstrap",
    dataTables_rsp: "js/vendor/dataTables.responsive",
    dataTables_fh: "js/vendor/dataTables.fixedHeader",
    messager: "js/vendor/messenger/messenger",
    "bootstrap-dialog": "js/vendor/bootstrap-dialog",
    "bootstrap-switch": "js/vendor/bootstrap-switch",
    formAjax: "js/vendor/jquery.form",
    select2: "js/vendor/select2",
    jqueryUi: "js/vendor/jquery-ui",
    moment: "js/vendor/moment",
    daterangepicker: "js/vendor/daterangepicker",
    flowplayer: "js/vendor/flowplayer/flowplayer",
    "jquery.ui.widget": "js/vendor/jquery.ui.widget",
    uploadFiles: "js/vendor/jquery.fileupload",
    store: "js/vendor/store",
    holder: "js/vendor/holder",
    tree: "js/vendor/tree.jquery",
    "amcharts": "js/vendor/amcharts",
    "amcharts.serial": "js/vendor/serial",
    "amcharts.pie": "js/vendor/pie",

    // Module deps.
    adspaceSize: "js/modules/adspaceSize",
    backToTop: "js/modules/backToTop",
    creativeList: "js/modules/creativeList",
    dataTable: "js/modules/dataTable",
    dateRange: "js/modules/dateRange",
    formChecky: "js/modules/formChecky",
    multiFormValidator: "js/modules/multiFormValidator",
    formValidator: "js/modules/formValidator",
    func: "js/modules/func",
    geoList: "js/modules/geoList",
    listAsyncOp: "js/modules/listAsyncOp",
    loading: "js/modules/loading",
    notification: "js/modules/notification",
    pageInit: "js/modules/pageInit",
    params: "js/modules/params",
    reportList: "js/modules/reportList",
    siderMenu: "js/modules/siderMenu",
    slidePanel: "js/modules/slidePanel",
    tableColumnResize: "js/modules/tableColumnResize",
    timeInterval: "js/modules/timeInterval",
    topHeader: "js/modules/topHeader",
    urlValidator: "js/modules/urlValidator",
    materialPreview: "js/modules/materialPreview",
    languageMap: "js/modules/languageMap",
    app: "js/app"
  },
  shim: {
    bootstrap: {
      deps: ["jquery"]
    },
    highcharts: {
      deps: ["jquery"]
    },
    raphael: {
      exports: "Raphael"
    },
    morris: {
      deps: ["raphael"]
    },
    messager: {
      deps: ["jquery"]
    },
    "bootstrap-dialog": {
      deps: ["bootstrap"]
    },
    "bootstrap-switch": {
      deps: ["jquery"]
    },
    daterangepicker: {
      deps: ['moment']
    },
    'flowplayer': {
      deps: ['jquery']
    },
    'tree': {
      deps: ['jquery']
    },
    "amcharts.serial": {
      deps: [ 'amcharts' ]
    },
    'amcharts.pie': {
      deps: [ 'amcharts' ]
    }
  },
  modules: [
    /**
     * **Notice**: module names are relative to baseUrl/paths config.
     * First set up the common build layer.
     */
    {
      name: "js/site",
      /**
       * List common(current is site) dependencies here. Only need to list
       * top level dependencies, "include" will find nested dependencies.
       */
      include: [
        "jquery",
        "bootstrap",
        "jquery.cookie",
        "spin",
        "messager",
        'pageInit'
      ]
    },

    /**
     * Now set up a build layer for each main layer, but exclude
     * the common one(site). "exclude" will exclude nested
     * the nested, built dependencies from "site". Any
     * "exclude" that includes built modules should be
     * listed before the build layer that wants to exclude it.
     */
    /**
     * Libs build.
     */
    {
      name: "js/libs/func",
      exclude: ["js/site"]
    },
    /**
     * Login build.
     */
    {
      name: "js/site/login"
    },
    // Site.
    /**
     * Documentation build.
     */
    {
      name: "js/doc/privacy"
    },

    /**
     * App build.
     */
    // App.
    {
      name: "js/app",
      exclude: ["js/site"]
    },

    // Home.
    {
      name: "js/home/dashboard",
      exclude: ["js/site"]
    },
    {
      name: "js/home/userSettings",
      exclude: ["js/site"]
    },
    // Users
    {
      name: "js/users/newUsers",
      exclude: ["js/site"]
    }, 
    {
      name: "js/users/userList",
      exclude: ["js/site"]
    },
    {
      name: "js/users/usersEdit",
      exclude: ["js/site"]
    }, 
    // Brand.
    {
      name: "js/brand/brandList",
      exclude: ["js/site"]
    }, 
    {
      name: "js/brand/newBrand",
      exclude: ["js/site"]
    },  
    // CampaignLabel.
    {
      name: "js/label/labelList",
      exclude: ["js/site"]
    },
    {
      name: "js/label/newLabel",
      exclude: ["js/site"]
    },
    // Code
    // {
    //   name: "js/code/vam_dsp.min",
    //   exclude: ["js/site"]
    // },
    // Creative.
    {
      name: "js/creative/creativeList",
      exclude: ["js/site"]
    },
    {
      name: "js/creative/newCreative",
      exclude: ["js/site"]
    },
    {
      name: "js/creative/newVideoCreative",
      exclude: ["js/site"]
    },
    {
      name: "js/creative/newWebCreative",
      exclude: ["js/site"]
    },
    {
      name: "js/creative/newAppCreative",
      exclude: ["js/site"]
    },    
    {
      name: "js/creative/newMobileVideoCreative",
      exclude: ["js/site"]
    },
    {
      name: "js/creative/creativeVideoPreview",
      exclude: ["js/site"]
    },
    {
      name: "js/creative/creativeMobileVideoPreview",
      exclude: ["js/site"]
    },
    // CreativeSync.
    {
      name: "js/creativeSync/creativeSyncList",
      exclude: ["js/site"]
    },
    // Creativetemplate.
    {
      name: "js/creativeTemplate/creativeTemplateList",
      exclude: ["js/site"]
    },
    {
      name: "js/creativeTemplate/newCreativeTemplate",
      exclude: ["js/site"]
    },
    // DaddyCall.
    {
      name: "js/daddyCall/daddyCall",
      exclude: ["js/site"]
    },
    // Launch.
    {
      name: "js/launch/launchList",
      exclude: ["js/site"]
    },
    {
      name: "js/launch/newLaunch",
      exclude: ["js/site"]
    },
    // MediaList.
    {
      name: "js/mediaList/blackWhiteList",
      exclude: ["js/site"]
    },
    {
      name: "js/mediaList/mediaList",
      exclude: ["js/site"]
    },
    {
      name: "js/mediaList/newBlackWhite",
      exclude: ["js/site"]
    },
    // PackList.
    {
      name: "js/pack/packList",
      exclude: ["js/site"]
    },
    // Operate log.
    {
      name: "js/operateLog/logList",
      exclude: ["js/site"]
    },
    // Package.
    {
      name: "js/package/packageSync",
      exclude: ["js/site"]
    },
    // Profit setting.
    {
      name: "js/profitSetting/profitList",
      exclude: ["js/site"]
    },
    // PMP List.
    {
      name: "js/pmpList/pmpList",
      exclude: ["js/site"]
    },
    // Report.
    {
      name: "js/report/reportList",
      exclude: ["js/site"]
    },
    // ResourceSync.
    {
      name: "js/resourceSync/resourceSyncList",
      exclude: ["js/site"]
    },
    // Retarget.
    {
      name: "js/retarget/newRetarget",
      exclude: ["js/site"]
    },
    {
      name: "js/retarget/retargetList",
      exclude: ["js/site"]
    },
    // Solution
    {
      name: "js/solution/solutionList",
      exclude: ["js/site"]
    },
    {
      name: "js/solution/newSolutionBasic",
      exclude: ["js/site"]
    },
    // {
    //   name: "js/solution/newSolutionBidding",
    //   exclude: ["js/site"]
    // },
    {
      name: "js/solution/newSolutionResource",
      exclude: ["js/site"]
    },
    {
      name: "js/solution/newSolutionTarget",
      exclude: ["js/site"]
    },
    {
      name: "js/solution/newSolutionCreative",
      exclude: ["js/site"]
    },
    {
      name: "js/solution/newPcSolutionBasic",
      exclude: ["js/site"]
    },
    {
      name: "js/solution/newPcSolutionResource",
      exclude: ["js/site"]
    },
    {
      name: "js/solution/newPcSolutionTarget",
      exclude: ["js/site"]
    },
    {
      name: "js/solution/newPcSolutionCreative",
      exclude: ["js/site"]
    },
    {
      name: "js/solutionAudit/solutionList",
      exclude: ["js/site"]
    },
    // Tanx
    // {
    //   name: "js/tanx/tanxList",
    //   exclude: ["js/site"]
    // }
  ],
  fileExclusionRegExp: /^(r|build)\.(js|txt)$/,
  optimize: "uglify",
  skipDirOptimize: true,
  optimizeCss: "standard",
  wrap: true,
  waitSeconds: 15
}
